package com.woniuxy.dr_mall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.dr_mall.entity.DrAddress;
import com.woniuxy.dr_mall.mapper.DrAddressMapper;
import com.woniuxy.dr_mall.service.IDrAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张哲轩
 * @since 2021-08-11
 */
@Service
public class DrAddressServiceImpl extends ServiceImpl<DrAddressMapper, DrAddress> implements IDrAddressService {
    @Autowired
    private DrAddressMapper drAddressMapper;

    @Override
    public void editAddress(DrAddress drAddress) {
        drAddressMapper.editAddress(drAddress);
    }

    @Override
    public void editStatusIsNByUserId(Integer userId) {
        drAddressMapper.editStatusIsNByUserId(userId);
    }

    @Override
    public void editStatusIsYById(Integer id) {
        drAddressMapper.editStatusIsYById(id);
    }

    @Override
    public void delById(Integer id) {
        drAddressMapper.delById(id);
    }

    @Override
    public void addAddress(DrAddress drAddress) {
        drAddressMapper.addAddress(drAddress);
    }

    @Override
    public List<DrAddress> getAllByUserId(Integer userId) {
        List<DrAddress> list = drAddressMapper.getAllByUserId(userId);
        return list;
    }


}
